/**
 * Created by lenovo on 2018/10/24.
 */
public class test1 {
    public static void main(String [] args) {

        String key = "111";
        //49
        System.out.println("hashCode：" + key.hashCode());
        //49-->二进制110001
        //h >>> 16  = 0
        //110001 000000 亦或运算  110001  相同为1，不同为0
        int h=(key == null) ? 0 : (h = key.hashCode()) ^ (h >>> 16);
        System.out.println("亦或运算：" + h);
        //16-1=15-->二进制001111
        //h=49 -->二进制  110001
        //与运算 只要有一个为0，就为0 result=000001
        int i=  (16 - 1) & h;
        System.out.println("与运算：" + i);
        int k=  h%16;
        System.out.println("hashCode4：" + k);



        System.out.println("2^3运算的结果是 :"+(2^3));
        System.out.println("2&3运算的结果是 :"+(2&3));
        System.out.println("2<<3运算的结果是 :"+(2<<3));
        System.out.println("2>>3运算的结果是 :"+(2>>3));
    }
}
